﻿@model IEnumerable<SIFIET.Models.Post>
@{
    Layout = "";  
}
@{int cont = 0;}
@foreach (var item in Model)
{
    cont = cont + 1;
    <div class="views-row views-row-1 views-row-odd views-row-first">
        <li class="postNoticias">
	    <span class="categoriaNoticia">@item.Title | </span>
        @*@if (item.Abstract.Count() >= 50)
        {
            @Html.ActionLink(item.Abstract.Substring(50) + "...", "showPost", new { id = item.Id }) 
            
            <script type="text/javascript">
                $(document).ready(function() {
                $.ajax({
                    type : "POST",
                    url :  "@(Url.Action("Num_likes", "like", new { id = item.Id }))",
                    traditional : true,
                    data : {},
                    async : true,
                    success : function(data){
                    $("#@item.Id").html(data);
                    }
                });
                })
            </script>
                       
            <div class="like" id="@item.Id" style="width:50%">like</div>
            
            <script type="text/javascript">
                $(document).ready(function() {
                $.ajax({
                    type : "POST",
                    url :  "@(Url.Action("Calificacion", "startbox", new { id = item.Id }))",
                    traditional : true,
                    data : {},
                    async : true,
                    success : function(data){
                    $("#@cont").html(data);
                    }
                });
                })
            </script>
            <div class="cal" id="@cont">calificacion</div> 
        }
        else
        {
            @Html.ActionLink(item.Abstract, "showPost", new { id = item.Id })

            <script type="text/javascript">
                $(document).ready(function() {
                $.ajax({
                    type : "POST",
                    url :  "@(Url.Action("Num_likes", "like", new { id = item.Id }))",
                    traditional : true,
                    data : {},
                    async : true,
                    success : function(data){
                    $("#@item.Id").html(data);
                    }
                });
                })
            </script>
                       
            <div class="like" id="@item.Id" style="width:50%">like</div>
            
            <script type="text/javascript">
                $(document).ready(function() {
                $.ajax({
                    type : "POST",
                    url :  "@(Url.Action("Calificacion", "startbox", new { id = item.Id }))",
                    traditional : true,
                    data : {},
                    async : true,
                    success : function(data){
                    $("#@cont").html(data);
                    }
                });
                })
            </script>
            <div class="cal" id="@cont">calificacion</div> 
        }   *@                           
    </div>
} 